/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.booksku.dao;

import java.util.*;

import cn.edu.pku.wxlib.booksku.model.*;
import cn.edu.pku.wxlib.booksku.service.*;
import cn.edu.pku.wxlib.booksku.vo.query.*;
import cn.edu.pku.wxlib.vo.query.BookskuFullQuery;
import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


import org.springframework.stereotype.Repository;


@Repository
public class BookskuDao extends BaseIbatis3Dao<Booksku,BookskuQuery,java.lang.Integer>{
	
	@Override
	public String getIbatisMapperNamesapce() {
		return "Booksku";
	}
	
	public void saveOrUpdate(Booksku entity) {
		if(entity.getBookSkuid() == null) 
			save(entity);
		else 
			update(entity);
	}
	
	public Page findPage(BookskuQuery query) {
		return pageQuery("Booksku.findPage",query);
	}

	public Page findFull(BookskuFullQuery query) {
		return pageQuery("Booksku.findFullPage",query);
	}
	
	public List<Booksku> findByBookId(java.lang.Integer id){
		return getSqlSessionTemplate().selectList("Booksku.findByBookId",id);
	}
}
